package com.chanyachting.emall.action.newsactivity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Member;
import com.chanyachting.emall.domain.Newsactivity;
import com.chanyachting.emall.form.NewsActivityForm;
import com.chanyachting.emall.service.MemberService;
import com.chanyachting.emall.service.NewsActivityService;
import com.chanyachting.emall.serviceImpl.NewsActivityServiceImpl;
import com.chanyachting.emall.util.RequestUtil;

public class DeleteAction extends Action {

	
	
	//删除新闻活动
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		NewsActivityForm naForm=(NewsActivityForm)form;
		
		NewsActivityService naservice=new NewsActivityServiceImpl();
		
		Newsactivity na=new Newsactivity();
		
		RequestUtil ru=new RequestUtil(request);
		
		Member member=(Member)ru.getSessionObject(MemberService.MEMBER_IN_SESSION,new Member());
		
		na.setMemberId(member.getId());
		
		na.setId(naForm.getId());
		
		na.setStatus("00");
		
		naservice.deleteNewsActivity(na);
		
		return mapping.findForward("noReleasenewsactivityList");
		
	}
	
	
	

}
